package com.ruoyi.base.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.base.domain.BaseMat;
import com.ruoyi.base.domain.BaseTask;
import com.ruoyi.base.mapper.BaseMatMapper;
import com.ruoyi.base.mapper.BaseTaskMapper;
import com.ruoyi.base.service.IBaseTaskService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 出入库任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-14
 */
@Service
public class BaseTaskServiceImpl extends ServiceImpl<BaseTaskMapper, BaseTask> implements IBaseTaskService
{
    @Autowired
    private BaseTaskMapper baseTaskMapper;

    /**
     * 查询出入库任务
     * 
     * @param id 出入库任务主键
     * @return 出入库任务
     */
    @Override
    public BaseTask selectBaseTaskById(Long id)
    {
        return baseTaskMapper.selectBaseTaskById(id);
    }

    /**
     * 查询出入库任务列表
     * 
     * @param baseTask 出入库任务
     * @return 出入库任务
     */
    @Override
    public List<BaseTask> selectBaseTaskList(BaseTask baseTask)
    {
        return baseTaskMapper.selectBaseTaskList(baseTask);
    }

    /**
     * 新增出入库任务
     * 
     * @param baseTask 出入库任务
     * @return 结果
     */
    @Override
    public int insertBaseTask(BaseTask baseTask)
    {
        baseTask.setCreateTime(DateUtils.getNowDate());
        return baseTaskMapper.insertBaseTask(baseTask);
    }

    /**
     * 修改出入库任务
     * 
     * @param baseTask 出入库任务
     * @return 结果
     */
    @Override
    public int updateBaseTask(BaseTask baseTask)
    {
        baseTask.setUpdateTime(DateUtils.getNowDate());
        return baseTaskMapper.updateBaseTask(baseTask);
    }

    /**
     * 批量删除出入库任务
     * 
     * @param ids 需要删除的出入库任务主键
     * @return 结果
     */
    @Override
    public int deleteBaseTaskByIds(Long[] ids)
    {
        return baseTaskMapper.deleteBaseTaskByIds(ids);
    }

    /**
     * 删除出入库任务信息
     * 
     * @param id 出入库任务主键
     * @return 结果
     */
    @Override
    public int deleteBaseTaskById(Long id)
    {
        return baseTaskMapper.deleteBaseTaskById(id);
    }
}
